/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.OneCommerceProject.beans;

import com.OneCommerceProject.entities.Item;
import com.OneCommerceProject.entities.Photos;
import com.OneCommerceProject.entities.Prix;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Aymen
 */
@Stateless
public class PrixFacade extends AbstractFacade<Prix> {
    @PersistenceContext(unitName = "OneCommerceProjectPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public PrixFacade() {
        super(Prix.class);
    }
    public List<Prix> findByItem(Item iditem){
        Map<String, Object> parameters = new HashMap<String, Object>();        
	parameters.put("iditem", iditem);		
        return super.findMultipleResults(Prix.FIND_BY_IDITEM, parameters);
    }
    
    public List<Prix> findByItemOrdredByDate(Item iditem){
        Map<String, Object> parameters = new HashMap<String, Object>();        
	parameters.put("iditem", iditem);		
        return super.findMultipleResults(Prix.FIND_ITEM_ORDER_BY_DATE, parameters);
    }

}
